<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of tt_mat_to_vec</title>
  <meta name="keywords" content="tt_mat_to_vec">
  <meta name="description" content="Flattens TT-matrix into TT-vector in the TT1.0 format">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="#">tt2</a> &gt; <a href="index.html">core</a> &gt; tt_mat_to_vec.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for tt2/core&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>tt_mat_to_vec
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>Flattens TT-matrix into TT-vector in the TT1.0 format</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function [tt_vec]=tt_mat_to_vec(tt_mat) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">Flattens TT-matrix into TT-vector in the TT1.0 format
   [TT_VEC]=TT_MAT_TO_VEC(TT_MAT) Flattens TT matrix TT_MAT to a 
   vector TT_VEC. Please avoid its usage: it will be removed in
   future releases. Use tt_tensor constructor from the object-oriented 
   version


 TT Toolbox 1.1, 2009-2010

This is TT Toolbox, written by Ivan Oseledets, Olga Lebedeva
Institute of Numerical Mathematics, Moscow, Russia
webpage: http://spring.inm.ras.ru/osel

For all questions, bugs and suggestions please mail
ivan.oseledets@gmail.com
---------------------------</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>	Mode sizes of the TT-matrix</li><li><a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>	Reshape of the TT-tensor</li><li><a href="../../tt2/@tt_tensor/size.html" class="code" title="function [sz] = size(tt,dim)">size</a>	Mode sizes of the TT-tensor</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="../../tt2/@tt_matrix/tt_matrix.html" class="code" title="function t = tt_matrix(varargin)">tt_matrix</a>	TT_matrix class constructor</li><li><a href="tt_mat_compr.html" class="code" title="function [res]=tt_mat_compr(mat,eps, max_rank)">tt_mat_compr</a>	Tensor rounding for the TT-matrix in TT1.0 format</li><li><a href="../../tt2/exp/canm_to_qtt.html" class="code" title="function [tt]=canm_to_qtt(can,rmax,eps)">canm_to_qtt</a>	Converts a canonical representation to QTT-format</li><li><a href="../../tt2/exp/test_qlaplace_dd.html" class="code" title="">test_qlaplace_dd</a>	test code for tt_qlaplace_dd()</li><li><a href="../../tt2/exp/test_qlaplace_dn.html" class="code" title="">test_qlaplace_dn</a>	test code for tt_qlaplace_dn()</li><li><a href="../../tt2/exp/test_qlaplacex_dd.html" class="code" title="">test_qlaplacex_dd</a>	test code for tt_qlaplacex_dd()</li><li><a href="../../tt2/exp/test_qlaplacex_dn.html" class="code" title="">test_qlaplacex_dn</a>	test code for tt_qlaplacex_dn()</li><li><a href="../../tt2/exp/test_qlaplacez_dd.html" class="code" title="">test_qlaplacez_dd</a>	test code for tt_qlaplacez_dd()</li><li><a href="../../tt2/exp/test_qlaplacez_dn.html" class="code" title="">test_qlaplacez_dn</a>	test code for tt_qlaplacez_dn()</li><li><a href="../../tt2/exp/tt_minres_selfprec.html" class="code" title="function [X]=tt_minres_selfprec(A, tol, eps, maxit, prec_type)">tt_minres_selfprec</a>	Computation of the approximate TT-matrix inverse using self-prec method</li><li><a href="../../tt2/exp/tt_mmk2.html" class="code" title="function [ttm12] = tt_mmk2(ttm1, ttm2, eps, max_r, max_swp)">tt_mmk2</a>	DMRG/Krylov matrix-by-matrix multiplication</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [tt_vec]=tt_mat_to_vec(tt_mat)</a>
0002 <span class="comment">%Flattens TT-matrix into TT-vector in the TT1.0 format</span>
0003 <span class="comment">%   [TT_VEC]=TT_MAT_TO_VEC(TT_MAT) Flattens TT matrix TT_MAT to a</span>
0004 <span class="comment">%   vector TT_VEC. Please avoid its usage: it will be removed in</span>
0005 <span class="comment">%   future releases. Use tt_tensor constructor from the object-oriented</span>
0006 <span class="comment">%   version</span>
0007 <span class="comment">%</span>
0008 <span class="comment">%</span>
0009 <span class="comment">% TT Toolbox 1.1, 2009-2010</span>
0010 <span class="comment">%</span>
0011 <span class="comment">%This is TT Toolbox, written by Ivan Oseledets, Olga Lebedeva</span>
0012 <span class="comment">%Institute of Numerical Mathematics, Moscow, Russia</span>
0013 <span class="comment">%webpage: http://spring.inm.ras.ru/osel</span>
0014 <span class="comment">%</span>
0015 <span class="comment">%For all questions, bugs and suggestions please mail</span>
0016 <span class="comment">%ivan.oseledets@gmail.com</span>
0017 <span class="comment">%---------------------------</span>
0018 d=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat,1);
0019 tt_vec=cell(d,1);
0020 r=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{1},3);
0021 n=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{1},1);
0022 m=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{1},2);
0023 tt_vec{1}=<a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>(tt_mat{1},[n*m,r]);
0024 r=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{d},3);
0025 n=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{d},1);
0026 m=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{d},2);
0027 tt_vec{d}=<a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>(tt_mat{d},[n*m,r]);
0028 
0029 <span class="keyword">for</span> i=2:d-1
0030    r2=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{i},3);
0031    r3=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{i},4);
0032    n=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{i},1);
0033    m=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt_mat{i},2);
0034   tt_vec{i} = <a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>(tt_mat{i},[n*m,r2,r3]);
0035 <span class="keyword">end</span>
0036 <span class="keyword">return</span>
0037 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Wed 08-Feb-2012 18:20:24 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>